package com.she.olympic;

import ken.app.helper.Helper;
import com.she.olympic.R;
import android.app.Activity;
import android.content.Context;
import android.util.AttributeSet;
import android.widget.FrameLayout;
import android.widget.ImageView;

public class MainGroup extends FrameLayout {
	ImageView mImageView;

	public MainGroup(Context context, AttributeSet attrs) {
		super(context, attrs);

		mImageView = new ImageView(context);
		mImageView.setImageBitmap(Helper.readBitMap(context, R.drawable.b_01_2));
		addView(mImageView);
	}

	@Override
	protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
		// super.onLayout(changed, left, top, right, bottom);
		mImageView.layout((int) (width / 2.2f), (int) (height * 0.8f), width, height);
	}

	int width;
	int height;

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		width = MeasureSpec.getSize(widthMeasureSpec);
		height = MeasureSpec.getSize(heightMeasureSpec);
		mImageView.setLayoutParams(new LayoutParams(width / 2, height / 3));
		// mImageView.layout(width/2, (int)(height*0.65f), width,
		// (int)(height*0.75f));

	}

}